3.44 \(\int \frac{\csc (e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=99 \[ \frac{\sqrt{b} (3 a+b) \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{2 a^{3/2} f (a+b)^2}-\frac{b \cos (e+f x)}{2 a f (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)^2} \]

[Out]

(Sqrt[b]*(3*a + b)*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(2*a^(3/2)*(a + b)^2*f) - ArcTanh[Cos[e + f*x]]/((a
 + b)^2*f) - (b*Cos[e + f*x])/(2*a*(a + b)*f*(b + a*Cos[e + f*x]^2))

________________________________________________________________________________________

Rubi [A]  time = 0.106569, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {4133, 470, 522, 206, 205} \[ \frac{\sqrt{b} (3 a+b) \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{2 a^{3/2} f (a+b)^2}-\frac{b \cos (e+f x)}{2 a f (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac{\tanh ^{-1}(\cos (e+f x))}{f (a+b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(Sqrt[b]*(3*a + b)*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(2*a^(3/2)*(a + b)^2*f) - ArcTanh[Cos[e + f*x]]/((a
 + b)^2*f) - (b*Cos[e + f*x])/(2*a*(a + b)*f*(b + a*Cos[e + f*x]^2))

Rule 4133

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, -Dist[ff/f, Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*(ff*x)^n)^p)/(ff*x)^(n*
p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(a*e^(2
*n - 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*n*(b*c - a*d)*(p + 1)), x] + Dist[e^(2
*n)/(b*n*(b*c - a*d)*(p + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) +
(a*d*(m - n + n*q + 1) + b*c*n*(p + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^4}{\left (1-x^2\right ) \left (b+a x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{b \cos (e+f x)}{2 a (a+b) f \left (b+a \cos ^2(e+f x)\right )}+\frac{\operatorname{Subst}\left (\int \frac{b+(-2 a-b) x^2}{\left (1-x^2\right ) \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{2 a (a+b) f}\\ &=-\frac{b \cos (e+f x)}{2 a (a+b) f \left (b+a \cos ^2(e+f x)\right )}-\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{(a+b)^2 f}+\frac{(b (3 a+b)) \operatorname{Subst}\left (\int \frac{1}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{2 a (a+b)^2 f}\\ &=\frac{\sqrt{b} (3 a+b) \tan ^{-1}\left (\frac{\sqrt{a} \cos (e+f x)}{\sqrt{b}}\right )}{2 a^{3/2} (a+b)^2 f}-\frac{\tanh ^{-1}(\cos (e+f x))}{(a+b)^2 f}-\frac{b \cos (e+f x)}{2 a (a+b) f \left (b+a \cos ^2(e+f x)\right )}\\ \end{align*}

Mathematica [C]  time = 1.13839, size = 384, normalized size = 3.88 \[ \frac{\sec ^3(e+f x) (a \cos (2 (e+f x))+a+2 b) \left (\frac{\sqrt{b} (3 a+b) \sec (e+f x) (a \cos (2 (e+f x))+a+2 b) \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}-i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}-\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{a^{3/2}}+\frac{\sqrt{b} (3 a+b) \sec (e+f x) (a \cos (2 (e+f x))+a+2 b) \tan ^{-1}\left (\frac{\sin (e) \tan \left (\frac{f x}{2}\right ) \left (-\sqrt{a}+i \sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2}\right )+\cos (e) \left (\sqrt{a}+\sqrt{a+b} \sqrt{(\cos (e)-i \sin (e))^2} \tan \left (\frac{f x}{2}\right )\right )}{\sqrt{b}}\right )}{a^{3/2}}-2 \sec (e+f x) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right ) (a \cos (2 (e+f x))+a+2 b)+2 \sec (e+f x) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right ) (a \cos (2 (e+f x))+a+2 b)-\frac{2 b (a+b)}{a}\right )}{8 f (a+b)^2 \left (a+b \sec ^2(e+f x)\right )^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x]^3*((-2*b*(a + b))/a + (Sqrt[b]*(3*a + b)*ArcTan[((-Sqrt[a] - I*Sq
rt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] - Sqrt[a + b]*Sqrt[(Cos[e] - I*Si
n[e])^2]*Tan[(f*x)/2]))/Sqrt[b]]*(a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x])/a^(3/2) + (Sqrt[b]*(3*a + b)*Arc
Tan[((-Sqrt[a] + I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] + Sqrt[a + b
]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]]*(a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x])/a^(3/2) - 2
*(a + 2*b + a*Cos[2*(e + f*x)])*Log[Cos[(e + f*x)/2]]*Sec[e + f*x] + 2*(a + 2*b + a*Cos[2*(e + f*x)])*Log[Sin[
(e + f*x)/2]]*Sec[e + f*x]))/(8*(a + b)^2*f*(a + b*Sec[e + f*x]^2)^2)

________________________________________________________________________________________

Maple [A]  time = 0.085, size = 172, normalized size = 1.7 \begin{align*} -{\frac{\ln \left ( 1+\cos \left ( fx+e \right ) \right ) }{2\,f \left ( a+b \right ) ^{2}}}-{\frac{b\cos \left ( fx+e \right ) }{2\,f \left ( a+b \right ) ^{2} \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{{b}^{2}\cos \left ( fx+e \right ) }{2\,f \left ( a+b \right ) ^{2}a \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{3\,b}{2\,f \left ( a+b \right ) ^{2}}\arctan \left ({a\cos \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{{b}^{2}}{2\,f \left ( a+b \right ) ^{2}a}\arctan \left ({a\cos \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{\ln \left ( -1+\cos \left ( fx+e \right ) \right ) }{2\,f \left ( a+b \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x)

[Out]

-1/2/f/(a+b)^2*ln(1+cos(f*x+e))-1/2/f/(a+b)^2*b*cos(f*x+e)/(b+a*cos(f*x+e)^2)-1/2/f/(a+b)^2*b^2/a*cos(f*x+e)/(
b+a*cos(f*x+e)^2)+3/2/f/(a+b)^2*b/(a*b)^(1/2)*arctan(a*cos(f*x+e)/(a*b)^(1/2))+1/2/f/(a+b)^2*b^2/a/(a*b)^(1/2)
*arctan(a*cos(f*x+e)/(a*b)^(1/2))+1/2/f/(a+b)^2*ln(-1+cos(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 0.72682, size = 932, normalized size = 9.41 \begin{align*} \left [\frac{{\left ({\left (3 \, a^{2} + a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt{-\frac{b}{a}} \log \left (-\frac{a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt{-\frac{b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - 2 \,{\left (a b + b^{2}\right )} \cos \left (f x + e\right ) - 2 \,{\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) + 2 \,{\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{4 \,{\left ({\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}, \frac{{\left ({\left (3 \, a^{2} + a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt{\frac{b}{a}} \arctan \left (\frac{a \sqrt{\frac{b}{a}} \cos \left (f x + e\right )}{b}\right ) -{\left (a b + b^{2}\right )} \cos \left (f x + e\right ) -{\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) +{\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{2 \,{\left ({\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

[1/4*(((3*a^2 + a*b)*cos(f*x + e)^2 + 3*a*b + b^2)*sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x
+ e) - b)/(a*cos(f*x + e)^2 + b)) - 2*(a*b + b^2)*cos(f*x + e) - 2*(a^2*cos(f*x + e)^2 + a*b)*log(1/2*cos(f*x
+ e) + 1/2) + 2*(a^2*cos(f*x + e)^2 + a*b)*log(-1/2*cos(f*x + e) + 1/2))/((a^4 + 2*a^3*b + a^2*b^2)*f*cos(f*x
+ e)^2 + (a^3*b + 2*a^2*b^2 + a*b^3)*f), 1/2*(((3*a^2 + a*b)*cos(f*x + e)^2 + 3*a*b + b^2)*sqrt(b/a)*arctan(a*
sqrt(b/a)*cos(f*x + e)/b) - (a*b + b^2)*cos(f*x + e) - (a^2*cos(f*x + e)^2 + a*b)*log(1/2*cos(f*x + e) + 1/2)
+ (a^2*cos(f*x + e)^2 + a*b)*log(-1/2*cos(f*x + e) + 1/2))/((a^4 + 2*a^3*b + a^2*b^2)*f*cos(f*x + e)^2 + (a^3*
b + 2*a^2*b^2 + a*b^3)*f)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.16464, size = 385, normalized size = 3.89 \begin{align*} -\frac{\frac{{\left (3 \, a b + b^{2}\right )} \arctan \left (-\frac{a \cos \left (f x + e\right ) - b}{\sqrt{a b} \cos \left (f x + e\right ) + \sqrt{a b}}\right )}{{\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sqrt{a b}} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{2} + 2 \, a b + b^{2}} + \frac{2 \,{\left (a b + b^{2} + \frac{a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}}{{\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )}{\left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/2*((3*a*b + b^2)*arctan(-(a*cos(f*x + e) - b)/(sqrt(a*b)*cos(f*x + e) + sqrt(a*b)))/((a^3 + 2*a^2*b + a*b^2
)*sqrt(a*b)) - log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/(a^2 + 2*a*b + b^2) + 2*(a*b + b^2 + a*b*(cos(f*x +
 e) - 1)/(cos(f*x + e) + 1) - b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/((a^3 + 2*a^2*b + a*b^2)*(a + b + 2*a
*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(c
os(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)))/f